﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Linq;
using System.Web;

namespace GodSoft.Code
{
    /// <summary>
    /// 配置仓库
    /// </summary>
    public class GodSoftConfiguration
    {
          //缓存连接字符串
        private static string dbConnectionString;
        //缓存数据提供器名称
        private static string dbProviderName;
        //保存站点名称
        private readonly static string siteName;
        static GodSoftConfiguration()
        {
            dbConnectionString = ConfigurationManager.ConnectionStrings["GodSoftContext"].ConnectionString;
            dbProviderName = ConfigurationManager.ConnectionStrings["GodSoftContext"].ProviderName;
            siteName=ConfigurationManager.AppSettings["SiteName"];
        
        }

        public static string DbConnectionString
        {
            get
            {
                return dbConnectionString;
            }

        }

        public static string DbProviderName
        {
            get
            {
                return dbProviderName;
            }
        }
        //返回邮件服务器地址
        public static string MailServer
        {
            get { return ConfigurationManager.AppSettings["MailServer"]; }

        }
        //返回电子邮件用户名
        public static string MailUserName
        { get { return ConfigurationManager.AppSettings["MailUserName"]; } }

        //返回邮件密码
        public static string MailPassWord
        { get { return ConfigurationManager.AppSettings["MailPassWord"]; } }
        public static string MailFrom
        { get { return ConfigurationManager.AppSettings["MailFrom"]; } }
        //发送错误日志邮件?
        public static bool EnableErrorLogEmail
        {
            get
            {
                return bool.Parse(ConfigurationManager.AppSettings["EnableErrorLogEmail"]);
            }
        }
        //返回发送错误报告的电子邮件地址
        public static string ErrorLogEmail
        {
            get
            { return ConfigurationManager.AppSettings["ErrorLogEmail"]; }
        }
        //站点名
        public static string SiteName
        {
            get { return siteName; }
        }


    }
}